#pragma once

#define HTTP_BUFFER_LENGTH 1024


typedef struct _SRUNX_CLIENT_INFO {
	CHAR username[LENGTH_STRING_MAX_CONFIG];
	CHAR password[LENGTH_STRING_MAX_CONFIG];
	CHAR mode[3];
} SRUNX_CLIENT_INFO;

class module_client
{
public:
	module_client(void);
	~module_client(void);
	BOOL login(SRUNX_CLIENT_INFO *);
	BOOL logout();
	UINT getState();// 0: Offline; 1: Online; 2: Logging Off; 4 Logging On
private:
	SRUNX_CLIENT_INFO clientInfo;

	VOID encrypt(CHAR * , CHAR * , CHAR * );
	BOOL CheckIsUID(CHAR * );
	VOID MakeHttpHead(CHAR * , CHAR * , CHAR * );
	BOOL HttpRequest(CHAR * , CHAR * );
	CHAR IP[16];
	CHAR UID[16];
	SOCKADDR_IN server;
	UINT state;
};
